package main

/*
* Author: JacksonCoder
* CreateTime: 2024/12/1
 */

type Inner struct {
}

func (i Inner) DoSomething() {
	println("这是 inner")
}

type Outer struct {
	Inner
}

type OuterV1 struct {
	Inner
}

func (o OuterV1) DoSomething() {
	println("这是 outer")
}

type OuterPtr struct {
	*Inner
}

type OOOOuter struct {
	Outer
}

func UseInner() {
	var o Outer
	o.DoSomething()
	o.Inner.DoSomething()

	var op *OuterPtr
	op.DoSomething()

	o1 := Outer{
		Inner: Inner{},
	}

	op1 := OuterPtr{
		Inner: &Inner{},
	}

	o1.DoSomething()

	op1.DoSomething()

}

func main() {
	var o1 OuterV1
	o1.DoSomething()
	o1.Inner.DoSomething()
}
